/*
 * @Author: wangtao
 * @Date: 2020-06-29 09:20:28
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-04-16 17:08:16
 * @Description: file content
 */

import {
  fetchGet,
  fetchPost,
  fetchDel,
  fetchPut,
  fetchPostImg,
  fetchPostUrl,
} from '../config';

/**
 * @description: 获取商品详情
 * @param {type} goodsId
 * @return: 
 */
export const featchGoodsDetail = (params) => {
  return fetchGet(`shop-api/api/v1/pi/getGoodsById`, params);
};


/**
 * @description: 确认实体商品订单
 * @param {type} goodsId
 * @return: 
 */
export const featchGoodsOrderConfirm = (params) => {
  return fetchPost(`order-api/api/v1/order/confirmOrder`, params);
};

/**
 * @description: 提交实体商品订单
 * @param {type} 
 * @return: 
 */
export const featchGoodsSubmitOrder = (params) => {
  return fetchPost(`order-api/api/v1/order/submitOrder`, params);
};

/**
 * @description: 确认支付
 * @param {type} 
 * @return: 
 */
export const featchOrderConfirmPay = (params) => {
  return fetchPost(`pay-api/api/v1/pay/payOrder`, params);
};


/**
 * @description: 支付同步验证
 * @param {type} goodsId
 * @return: 
 */
export const featchSyncVerifiPay = (params) => {
  return fetchGet(`pay-api/api/v1/confirm/confirmPay`, params);
};


/**
 * @description: 获取车辆详情
 * @param {type} goodsId
 * @return: 
 */
export const featchCarDetailImg = (params) => {
  return fetchGet(`shop-api/api/v1/subgraphApp/getGoodsSubgraph`, params);
};

/**
 * @description: 查询三级分类
 * @param {type} goodsId
 * @return: 
 */
export const getCategory = ({gcCode}) => {
  return fetchGet(`shop-api/api/v1/pi/getCategory?gcCode=${gcCode}`);
};


/**
 * @description: 获取商品自提点
 * @param {type} goodsId
 * @return: 
 */
export const getGoodsAddress = ({goodsId}) => {
  return fetchGet(`shop-api/api/v1/pi/getGoodsAddress?goodsId=${goodsId}`);
};
/**
 * @description: 获取商品sku
 * @param {type} goodsId
 * @return: 
 */
export const getGoodsSku = ({goodsId,addressId}) => {
  return fetchGet(`shop-api/api/v1/pi/getGoodsSku?goodsId=${goodsId}&addressId=${addressId}`);
};

/**
 * @description: 商贸商场商品一级分类B2B
 * @param {type} goodsId
 * @return: 
 */
export const getTradeGoodsCategory = (params) => {
  return fetchGet(`goods-api/api/v1/tradeGoods/tradeGoodsCategory`,params);
};

/**
 * @description: 商贸商场商品分页B2B
 * @param {type} goodsId
 * @return: 
 */
export const getPageSpuByOneCategoryId = (params) => {
  return fetchGet(`goods-api/api/v1/tradeGoods/pageSpuByOneCategoryId`,params);
};

/**
 * @description: 商贸商场商品详情B2B
 * @param {type} goodsId
 * @return: 
 */
export const getTradeGoodsSpuDetails = ({spuId}) => {
  return fetchGet(`goods-api/api/v1/tradeGoods/spuDetails/${spuId}`);
};

/**
 * @description: 商品SKULISTB2B
 * @param {type} goodsId
 * @return: 
 */
export const getTradeGoodsSkuList = ({spuId}) => {
  return fetchGet(`goods-api/api/v1/tradeGoods/skuList/${spuId}`);
};

/**
 * @description: 商品询价电话
 * @param 
 * @return: 
 */
export const getCustomerHotline = () => {
  return fetchGet(`goods-api/api/v1/merchantGoods/inquiry/getCustomerHotline`);
};
